/*******************************************************************************
 * Copyright 2011 Mauro Luigi Drago (drago.luigi@gmail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package com.bytenose.extrautils.logging;

import com.bytenose.extrautils.annotations.NonNullable;
import com.bytenose.extrautils.base.IDisposable;

/**
 * Base interface for error loggers.
 * 
 * @author Mauro Luigi Drago
 * 
 */
public interface ILogger extends IDisposable {
	/**
	 * Logs an information message.
	 * 
	 * @param message the warning message, cannot be null.
	 * @throws IllegalArgumentException
	 *		if some of the non nullable arguments are null.
	 */
	void logInfo(@NonNullable String message) throws IllegalArgumentException;

	/**
	 * Logs a warning.
	 * 
	 * @param message the warning message, cannot be null.
	 * @throws IllegalArgumentException
	 * 		if some of the non nullable arguments are null.
	 */
	void logWarning(@NonNullable String message)
			throws IllegalArgumentException;

	/**
	 * Logs an error.
	 * 
	 * @param message the error message, cannot be null.
	 * @throws IllegalArgumentException
	 * 		if some of the non nullable arguments are null.
	 */
	void logError(@NonNullable String message) throws IllegalArgumentException;

	/**
	 * Logs a {@link Throwable}
	 * 
	 * @param e the error, cannot be null.
	 * @throws IllegalArgumentException
	 * 		if some of the non nullable arguments are null.
	 */
	void logError(@NonNullable Throwable e) throws IllegalArgumentException;

	/**
	 * Logs a {@link Throwable} with a user specified message preamble.
	 * 
	 * @param message the message preamble, cannot be null.
	 * @param e the error, cannot be null.
	 * @throws IllegalArgumentException
	 * 		if some of the non nullable arguments are null.
	 */
	void logError(@NonNullable String message, @NonNullable Throwable e)
			throws IllegalArgumentException;
}
